<template>
	<view>
		<view class="top">
			<view class="outimage">
			<image v-if!="imageurl=''" show-menu-by-longpress="true" @click="clickimage(imageurl)" class="mainimage" v-bind:src="imageurl"></image>
			</view>
			<view class="outtext">
			<text class="text" selectable="true">{{detail}}</text>
			</view>
		</view>
		<uni-popup ref="popup" type="message">
		    <uni-popup-message type="success" :duration="700" :message="message"></uni-popup-message>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imageurl:'',
				detail:'',
				message:''
			}
		},
		methods: {
			clickimage:function(url){
				uni.showLoading({title: '加载中',mask:true});
				uni.previewImage({
					current: 0,
					urls: [url],
					success(res) {
						setTimeout(function () {uni.hideLoading();}, 0)
					}
				})
				   
			}
		},
		onLoad(option) {
			this.message="长按发送给朋友"
			this.$refs.popup.open('top')
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			this.imageurl=option.imageurl
			this.detail=option.detail
			console.log(this.imageurl)
		}
	}
</script>

<style>
.top{
	display: flex;
	flex-wrap: nowrap;
	flex-direction: column;
}
.mainimage{
	width: 70vw;
}
.outimage{
	display: inline-flex;
	flex-direction: row;
	justify-content: center;
}
.outtext{
	display: inline-flex;
	flex-direction: row;
	justify-content: center;
	margin-top: 2vw;
}
.text{
	width: 60vw;
}
</style>
